<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="LoadProducts" method="post">
<c:set var="list" value="${sessionScope.gh.products}"/>
<c:choose>
 <c:when test="${empty list}">
  <h2 align="center">Không có sản phẩm nào trong giỏ hàng !!!</h2> 
 </c:when>
<c:otherwise>

<table border="1" width="100%">
<tr>
<td> Tên hoa </td>
<td> Giá </td>
<td> Số lượng </td>
<td> Số tiền</td>
<td> Tình trạng </td>
</tr>

<c:forEach var="p" items="${list}">
<tr>

<td><c:out value=" ${p.name } " /> </td>
<td> ${p.price} </td>
<td> ${p.quantities } </td>
<td> ${p.price * p.quantities}</td>
<td>
	<a href="LoadProducts?action=xoa&mahoa=${p.id}">Xóa</a>
 	<a href="LoadProducts?action=capnhat&mahoa=${p.id}">Cập nhật</a>
</td>

</tr>
</c:forEach>
<tr>
<td colspan="4" align="right">Tổng tiền </td>
<td > ${sessionScope.gh.total}</td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="hidden" name="action" value="muagiohang">
<input type="submit" value="Đồng ý mua" ></td>
<td colspan="2">
<input type="hidden" name="action" value="huygiohang">
<input type="submit" value="Hủy Giỏ Hàng"></td>
</tr>

</table>
</c:otherwise>
</c:choose>
</form>
</body>
</html>